interface Person {
    firstName: string;
    lastName: string;
    name?: string;
    props: Array<string>;
    [index: string]: any; // 索引签名
    (m: string, h: number): number; // 函数签名
}

class Student {
    private _firstName: string;
    private _lastName: string;

    /*constructor(public _firstName: string, public _lastName: string) {
        this._firstName = _firstName;
        this._lastName = _lastName;
    }*/
    constructor(firstName: string, lastName: string) {
        this._firstName = firstName;
        this._lastName = lastName;
    }

    get firstName(): string {
        return this._firstName;
    }

    set firstName(value: string) {
        this._firstName = value;
    }

    get lastName(): string {
        return this._lastName;
    }

    set lastName(value: string) {
        this._lastName = value;
    }
}

function fullName(person: Student): string {
    return `fullname is ${person.firstName} ${person.lastName}`
}
const stu = new Student("诸葛", "孔明");
document.body.innerHTML = fullName(stu)